.at-List {
    margin-top: @at-margin-top-list;
}

.at-List--empty {
    margin-top: @at-margin-top-list;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: @at-height-list-empty;
    border-radius: @at-border-radius;
    border: @at-border-default-width solid @at-color-list-empty-border;
    background-color: @at-color-list-empty-background;
    color: @at-color-list-empty;
    text-transform: uppercase;
    text-align: center;
    padding: @at-padding-list-empty;
}

.at-List-toolbar {
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: @at-margin-bottom-list-toolbar;
}

.at-List--toolbar-padAbove{
    margin-top: @at-margin-above-list-toolbar
}

.at-List-search {
    flex: auto;
}

.at-List-toolbarAction {
    margin-left: @at-margin-left-toolbar-action;
    display: flex;
    align-items: center;
    justify-content: center;
    height: @at-height-toolbar-action;
    border-radius: @at-border-radius;
    position: relative;
}

.at-List-toolbarActionButton {
    border: none;
    border-radius: @at-border-radius;
    min-width: 80px;
}

.at-List-toolbarActionDropdownMenu {
    border-top-right-radius: 0;
    border: 1px solid @at-gray-d7;
    float: right;
    left: auto;
    margin: 0;
    right: 0;
}

.at-List-toolbar--attached {
    display: flex;
    justify-content: flex-end;
    border: @at-border-default-width solid @at-color-list-border;
    border-bottom: none;
    border-radius: @at-border-radius;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.at-List-toolbar-item {
    padding: 2px 10px;
    border-left: 1px solid @at-color-list-border;
    border-right: 1px solid @at-color-list-border;

    &:hover {
        cursor: pointer;
        background: @at-gray-f2;
    }

    &:first-of-type {
        border-right: none;
    }

    &:last-of-type {
        border: none;
    }

    &:first-child {
        border-left: 1px solid @at-color-list-border;
    }

    &.active {
        background: @at-blue;
        color: @at-white;
    }
}

.at-List-container {
    border: @at-border-default-width solid @at-color-list-border;
    border-radius: @at-border-radius;

    & > div:last-of-type {
        border-bottom-left-radius:@at-border-radius;
    }
}

// Remove top left and right rounded corners of a list if there is a toolbar above it
.at-List-toolbar--attached + .at-List > .at-List-container {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.at-List-toolbar--attached + .at-List > .at-List-container{
    .at-Row--active {
        border-top-left-radius: 0;
    }
}

.at-List-toolbar--attached + .at-List {
    margin-top: 0;
}

.at-Row {
    display: grid;
    grid-template-columns: 10px 1fr;
}

.at-Row--collapsed {
    .at-Row-container--wrapped {
        visibility: hidden;
        opacity: 0;
        height: 0;
    }
}

.at-Row--active {
    border-left: @at-border-style-list-active-indicator;
    border-top-left-radius: @at-border-radius;
    border-top-right-radius: @at-border-radius;
}

.at-Row--active .at-Row--invalid {
    border-left: @at-white solid 1px;
}

.at-Row--active .at-Row-content {
    margin-left: -5px;
}

.at-Row ~ .at-Row {
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    border-top: @at-border-default-width solid @at-color-list-border;
}

.at-Row--invalid {
    align-items: center;
    background: @at-color-error;
    display: flex;
    justify-content: center;

    .at-Popover {
        padding: 0;

        &-icon i {
            color: @at-white;
        }

        &-icon i:hover {
            color: @at-white;
        }
    }
}

.at-Row-content {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    grid-column-start: 2;
    padding: @at-padding-list-row;
}

.at-Row-toggle {
    align-self: flex-start;
    margin-right: @at-space-4x;
}

.at-Row-actions {
    display: flex;
}

.at-Row-items {
    flex: 1;
}

.at-RowItem {
    align-items: center;
    line-height: @at-height-list-row-item;
    word-wrap: break-word;
    word-break: break-all;
    display: block;
    margin-right: 10px;
}

.at-RowItem-status {
    margin-right: @at-margin-right-list-row-item-status;
    & > a {
        cursor: pointer;
    }
}

.at-RowItem--isHeader {
    display: flex;
    color: @at-color-body-text;
    margin-bottom: @at-margin-bottom-list-header;
    line-height: @at-line-height-list-row-item-header;
}

.at-Row-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.at-Row-container--wrapped {
    display: flex;
    flex-wrap: wrap;
    visibility: visible;
    opacity: 1;
    height: auto;
    transition: visibility 0s, opacity 0.25s linear;
}

.at-RowItem--isHeaderLink {
    color: @at-blue;
    cursor: pointer;
}
.at-RowItem--isHeaderLink:hover {
    color: @at-blue-hover;
}

.at-RowItem--labels {
    line-height: @at-line-height-list-row-item-labels;
    display: inline-block;

    * {
        font-size: 10px;
    }
}

.at-RowItem-header {
    font-weight: bold;
}

.at-RowItem-tagContainer {
    display: inline-block;
    flex-wrap: wrap;
    line-height: initial;
}

.at-RowItem-tag {
    font-weight: 100;
    background-color: @at-color-list-row-item-tag-background;
    border-radius: @at-border-radius;
    color: @at-color-list-row-item-tag;
    font-size: @at-font-size-list-row-item-tag;
    margin: @at-space @at-space-4x;
    padding: @at-padding-list-row-item-tag;
    line-height: @at-line-height-list-row-item-tag;
    word-break: keep-all;
    display: inline-flex;
}

.at-RowItem-tag--primary {
    background: @at-color-list-row-item-tag-primary-background;
    color: @at-color-list-row-item-tag-primary;
}

.at-RowItem-tag--header, .at-RowItem-tag--secondary {
    line-height: inherit;
}

.at-RowItem-tagIcon {
    margin-right: @at-margin-right-list-row-item-tag-icon;
}

.at-RowItem-label {
    display: inline-block;
    text-transform: uppercase;
    color: @at-color-list-row-item-label;
    font-size: @at-font-size;
    margin-right: 10px;
}

.at-RowItem-value {
    display: inline-block;
    font-size: @at-font-size-3x;
    margin-right: 20px;
}

.at-RowItem-badge {
    background-color: @at-gray-646972;
    border-radius: @at-border-radius;
    color: @at-white;
    font-size: 11px;
    font-weight: normal;
    height: 14px;
    line-height: 10px;
    margin: 0 10px;
    padding: 2px 10px;
}

.at-RowAction {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: @at-margin-left-list-row-action;
    padding: @at-padding-list-row-action;
    background: @at-color-list-row-action-background;
    border-radius: @at-border-radius;
    height: @at-height-list-row-action;
    width: @at-width-list-row-action;

    i {
        font-size: @at-font-size-list-row-action-icon;
        color: @at-color-list-row-action-icon;
    }
}

.at-RowAction:hover {
    background-color: @at-color-list-row-action-hover;

    i {
        color: @at-color-list-row-action-icon-hover;
    }
}

.at-RowAction--danger:hover {
    background-color: @at-color-list-row-action-hover-danger;
}

.at-RowAction--disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.at-Row .at-Row-checkbox {
    align-self: start;
    margin: 2px 20px 0 0;
}

.at-RowItem--inline {
    display: inline-flex;
    margin-right: @at-margin-right-list-row-item-inline;

    .at-RowItem-label {
        width: auto;
        margin-right: @at-margin-right-list-row-item-inline-label;
    }
}

@media screen and (max-width: @at-breakpoint-instances-wrap) {
    .at-Row-items--instances {
        margin-bottom: @at-padding-bottom-instances-wrap;
    }
}

@media screen and (max-width: @at-breakpoint-compact-list) {
    .at-Row-actions {
        align-items: center;
    }

    .at-RowAction {
        margin: @at-margin-list-row-action-mobile;
    }

    .at-RowItem--inline {
        display: flex;
        margin-right: inherit;

        .at-RowItem-label {
            width: @at-width-list-row-item-label;
            margin-right: inherit;
        }
    }
}
